<?php
/**
 * shipping_agent SoapServer.
 *
 * @package shipping_agent
 * @copyright Copyright 2009 Structured Solutions
 * @license http://www.codeplex.com/ShippingAgent/license Microsoft Public License (Ms-PL)
 * @version 3.2
 */

	// Turn off wsdl caching while making changes to the definition or implementation.
	ini_set("soap.wsdl_cache_enabled", "0");
	
	/**
	 * Zen Cart constants.
	 */
	require("includes/application_top.php");
	/**
	 * shipping_agent implementation.
	 */
	require(DIR_WS_CLASSES . "shippingagent_impl.php");
	
	$server = new SoapServer(dirname(__FILE__) . "/shippingagent.wsdl");
	$server->setClass("shippingagent_impl");
	
	if (isset($HTTP_RAW_POST_DATA)) 
		$request = $HTTP_RAW_POST_DATA;
	else 
		$request = file_get_contents("php://input");
		
	if ($request == "")
		echo "Shipping Agent for Zen Cart";
	else 
		$server->handle($request);
?>